package com.example.demo;

import java.util.List;
import java.util.TimeZone;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.test.context.jdbc.Sql;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.example.service.UserMapper;


@RestController
@RequestMapping(value="/index")
public class HelloController {
	private static final Logger logger = LoggerFactory.getLogger(HelloController.class);
	
	@Value(value="${woniu.secret}")
	private String pro;
	
//	@Autowired
//	private UserMapper usermapper;
	
	
	@ResponseBody
	@RequestMapping(value="/hello/{hello}")
	public String hello(@PathVariable String hello){
		
		logger.debug("first time user log4j !");
		return  pro + hello +" hello world! this is spring boot!";
	}
	
	@RequestMapping(value="/showrolename/{status}")
	public List<String> getAvailableRoleName(@PathVariable String status){
		List<String> list = null;//usermapper.getAvailabelRoleName(status);
		return list;
	}
	
	public static void main(String[] args) {
		TimeZone zone = TimeZone.getDefault();
		String[] ids = TimeZone.getAvailableIDs();
		for (String id:ids) 
			System.out.println(id+"");
	}

}
